﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_Cruise_ctrCruise_Homepage : System.Web.UI.UserControl
{
    private int nRegion = 0;
    private int nCountry = 0;
    private int nCurrentLang = Support.GetCurrentLanguage();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            nCountry = getCountry();
            nRegion = getRegion();
            if (nCountry == 1 && (nRegion == 1 || nRegion == 2))
            {
                PlhContent.Controls.Clear();
                PlhContent.Controls.Add(Page.LoadControl("Controls/Cruise/ctrAboutCruise.ascx"));
            }
            setRegionTypeForCtrCruiseCatDetail();
        }
    }
    private int getCountry()
    {
        nCountry = ConvertData.ConvertToInt(Request.QueryString[Config.COUNTRY]);
        return nCountry;
    }
    private int getRegion()
    {
        nRegion = ConvertData.ConvertToInt(Request.QueryString[Config.CRUISEREGION]);
        return nRegion;
    }
    private void setRegionTypeForCtrCruiseCatDetail()
    {
        if (nCountry != 1)
            nRegion = 0;
        if(nCountry==0||nCountry>3)
            nCountry = 1;
        ctrCruiseCatDetail1.setCruiseRegion(nCountry, nRegion, 2, 7);
        ctrCruiseCatDetail2.setCruiseRegion(nCountry, nRegion, 1, 6);
    }
}